package com.cooge.sharevideo.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cooge.sharevideo.util.PageInfo;
import com.cooge.sharevideo.web.dao.VideoDao;
import com.cooge.sharevideo.web.pojo.Video;
import com.cooge.sharevideo.web.service.VideoService;
@Service
public class VideoServiceImpl implements VideoService {
	
	@Autowired
	VideoDao videoDao;

	@Override
	public Video getVideoById(Long id) {
		return videoDao.get(id);
	}

	@Override
	public List<Video> getVideoListBymenuId(Long menuId) {
		return videoDao.findVideolistByMenu(menuId,0,15);
	}

	@Override
	public PageInfo<Video> findPage(PageInfo<Video> p) {
		PageInfo<Video> page = new PageInfo<Video>(p,videoDao);
		return page;
	}
}
